package com.wavefront.obj.parser;

public abstract class LineParser {

	protected String[] words = null;
	
	private void setWords(String[] words) {
		this.words = words;
	}

	public void parse(String[] words)
	{
		//Log.d("wavefront.line", combine(words," "));
		this.setWords(words);
	}
	
	public static String combine(String[] s, String glue)
	{
	  int k = s.length;
	  if (k == 0)
	    return null;
	  StringBuilder out=new StringBuilder();
	  out.append(s[0]);
	  for (int x=1;x<k;++x)
	    out.append(glue).append(s[x]);
	  return out.toString();
	}

	public String getType() {
		return this.words[0];
	}

	public String getWord(int i) {
		return words[i];
	}

}
